package cn.kgc.dao;

import cn.kgc.pojo.AppCategory;
import cn.kgc.pojo.AppInfo;
import cn.kgc.pojo.AppVersion;
import cn.kgc.pojo.DataDictionary;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 后台管理dao类
 */

public interface AppMapper {

    List<AppInfo> queryAll(@Param("beginIndex") Integer beginIndex,
                           @Param("pageSize") Integer pageSize,
                           @Param(value = "softwareName") String softwareName,
                           @Param(value = "flatformId") Integer flatformId,
                           @Param(value = "categoryLevel1") Integer categoryLevel1,
                           @Param(value = "categoryLevel2") Integer categoryLevel2,
                           @Param(value = "categoryLevel3") Integer categoryLevel3,
                           @Param(value = "devId") Integer devId,
                           @Param(value = "status") Integer status
    );

    Integer totalRecode(@Param(value = "softwareName") String softwareName,
                        @Param(value = "flatformId") Integer flatformId,
                        @Param(value = "categoryLevel1") Integer categoryLevel1,
                        @Param(value = "categoryLevel2") Integer categoryLevel2,
                        @Param(value = "categoryLevel3") Integer categoryLevel3,
                        @Param(value = "devId") Integer devId,
                        @Param(value = "status") Integer status);

    int updateApp(@Param("softwareName")String softwareName,
                  @Param("APKName")String APKName,
                  @Param("supportROM")String supportROM,
                  @Param("interfaceLanguage")String interfaceLanguage,
                  @Param("softwareSize")BigDecimal softwareSize,
                  @Param("downloads")Integer downloads,
                  @Param("flatformId")Integer flatformId,
                  @Param("categoryLevel1")Integer categoryLevel1,
                  @Param("categoryLevel2")Integer categoryLevel2,
                  @Param("categoryLevel3")Integer categoryLevel3,
                  @Param("statusName")String statusName,
                  @Param("appInfo")String appInfo,
                  @Param("logoPicPath")String logoPicPath,
                  @Param("logoLocPath")String logoLocPath,
                  @Param("id")Integer id);


    int addApp(@Param("softwareName")String softwareName,@Param("APKName")String APKName,
               @Param("supportROM")String supportROM,@Param("interfaceLanguage")String interfaceLanguage,
               @Param("softwareSize")BigDecimal softwareSize,@Param("downloads")Integer downloads,
               @Param("flatformId")Integer flatformId,@Param("categoryLevel1")Integer categoryLevel1,
               @Param("categoryLevel2")Integer categoryLevel2,@Param("categoryLevel3")Integer categoryLevel3,
               @Param("statusName")String statusName,@Param("appInfo")String appInfo,
               @Param("logoPicPath")String logoPicPath,@Param("id")Integer id);

    int delApp(@Param("id")Integer id);

    int addVersion(@Param("versionNo")String versionNo,@Param("versionSize")BigDecimal versionSize,
                   @Param("publishStatus")Integer publishStatus,@Param("versionInfo")String versionInfo,
                   @Param("downloadLink")String downloadLink,@Param("id")Integer id);

    int updateVersion(@Param("versionNo")String versionNo,@Param("versionSize")BigDecimal versionSize,
                      @Param("publishStatus")String publishStatus,@Param("versionInfo")String versionInfo,
                      @Param("downloadLink")String downloadLink,@Param("apkLocPath")String apkLocPath,
                      @Param("apkFileName")String apkFileName,@Param("id")Integer id);

    List<DataDictionary> listPlatform(@Param("typeName") String typeName);


    List<AppCategory> listLv1();

    List<AppCategory> listLv2(@Param("parentId") Integer parentId);

    List<AppCategory> listLv3(@Param("categoryCode") String categoryCode, @Param("parentId") Integer parentId);

    List<AppInfo> queryById(Integer id);

    List<AppVersion> queryVersionById(Integer id);
}
